package game.module.dabt.logic;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import game.HallServer;
import game.module.dabt.dao.DabtdbDao;


public class DabtDbHelper {
	
	private static Logger logger = LoggerFactory.getLogger(DabtDbHelper.class);
	
	static class SingletonHolder {
		static DabtDbHelper instance = new DabtDbHelper();
	}

	public static DabtDbHelper getInstance() {
		return SingletonHolder.instance;
	}
	
	public void  asyncUpdateDabtIsPay(int playerId) {
		HallServer.executorService.execute(new Runnable() {
			
			@Override
			public void run() {
				// TODO Auto-generated method stub
				DabtdbDao.getInstance().updateDabtIsPay(playerId, true);// 异步处理
			}
		});
	}
	
	public void asyncupdateDabtNum(int playerId,int newnum) {
		HallServer.executorService.execute(new Runnable() {
			
			@Override
			public void run() {
				// TODO Auto-generated method stub
				DabtdbDao.getInstance().updateDabtNum(playerId, (int) newnum);// 异步处理
			}
		});
	}

	
}
